<!-- JAVASCRIPT -->
<script src="assets/libs/jquery/jquery.min.js"></script> 
<script src="assets/js/fb.min.js"></script>
<script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/libs/metismenu/metisMenu.min.js"></script>
<script src="assets/libs/node-waves/waves.min.js"></script>

<!-- Sweet Alerts js -->
<script src="assets/libs/sweetalert2/sweetalert2.min.js"></script>

<!-- Vue 文件 -->
<script src="assets/js/aes.js"></script>
<script src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>

<!-- Plugin Js-->
<script src="assets/js/app.js"></script>
<script src="assets/js/slick-loader.min.js"></script>

<!-- 系统文件 -->
<script src="assets/js/sy.js"></script>
<?php if ($conf['sykg']==1) {?>
<script type="text/javascript">
watermark('<?=$conf['sitename'];?>','昵称 : <?=$userrow['name'];?>','账号:<?=$userrow['uid'];?>');
</script>
<?}?>
<script type="text/javascript">
	$('#sjqy').click(function () {
		layer.prompt({ title: '请输入要转移的上级UID', formType: 3 }, function (uid, index) {
			layer.close(index);
			layer.prompt({ title: '请输入要转移的上级邀请码', formType: 3 }, function (yqm, index) {
				layer.close(index);
				// var load=layer.load(2);
				SlickLoader.setText('加载中...')
				SlickLoader.enable();
				$.ajax({
					type: "POST",
					url: "../apisub.php?act=sjqy",
					data: { "uid": uid, "yqm": yqm },
					dataType: 'json',
					success: function (data) {
						// layer.close(load);
						SlickLoader.disable();
						if (data.code == 1) {
							layer.msg(data.msg, { icon: 1 });
						} else {
							layer.msg(data.msg, { icon: 2 });
						}
					}
				});
			});
		});
	});
	$('#out').click(function () {
		Swal.fire({ title: '提示', text: "您确定要退出登录吗？", type: 'warning', showCancelButton: !0, confirmButtonColor: '#34c38f', cancelButtonColor: '#f46a6a', confirmButtonText: '确定', cancelButtonText: '取消' }).then(function (t) {
			if (t.value) {
				Swal.fire('成功', '退出登录成功！', 'success')
				window.location = '../apisub.php?act=logout'
			}
		})
	});
	var vm = new Vue({
		el: "#header",
		data: {
			isSun: true,
			noticeTxt: "<?=$conf['tcgonggao'];?>",
		},
		methods: {
			changeTheme:function(val) {
				this.isSun = !this.isSun
				window.location.reload();
				if(val === 1) {
					sessionStorage.setItem('is_visited', 'dark-mode-switch')
					console.log('暗夜模式')
				} else {
					sessionStorage.setItem('is_visited', 'light-mode-switch')
					console.log('日间模式')
				}
			},
			gettheme() {
				const theme = sessionStorage.getItem('is_visited')
				if(theme === 'dark-mode-switch') {
					this.isSun = false
				}
			},
			notice: function() {
				if(!this.noticeTxt) {
					console.log('没有内容');
				} else {
					Swal.fire({
						title: '重要公告',
						html: '<?=$conf['tcgonggao'];?>',
						showCloseButton: !0,
						confirmButtonClass: 'btn btn-success',
						confirmButtonColor: '#47bd9a',
						confirmButtonText: '知道了',
					})
				}
			}
		},
		mounted() {
			this.gettheme()
		}
	});
</script>